#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time   : 2022-06-06 17:51:04
# @Author : BanZhuanKe


import pytest
from utils.logging_utils.log_util import write_log


# 清空extract.yaml文件,在写之前使用清空
# 写入全局变量之前清空文件数据
from common.path_setting import ensure_path_sep


@pytest.fixture(scope="session", autouse=True)
def clear_extract_yaml():
    with open(ensure_path_sep("\\extract.yaml"), mode="w", encoding="utf-8") as file:
        write_log("\n")
        write_log("----------------------------------------------------------")
        write_log("清空操作")
        write_log("----------------------------------------------------------")
        file.truncate()
